#pragma once

#include <irrlicht.h>

using namespace irr;

struct MouseState
{
	core::position2di Position;
	bool LeftButtonDown;
	bool LeftButtonEventHandled;
	bool RightButtonDown;
	bool RightButtonEventHandled;
	f32 mouseDelta;
	//SMouseState() : LeftButtonDown(false) { }
	//SMouseState() : RightButtonDown(false) { }
};

class CustomEventReceiver : public IEventReceiver
{
	private:
        MouseState mouseState;

        bool keyIsDown[KEY_KEY_CODES_COUNT];
        bool keyIsHandled[KEY_KEY_CODES_COUNT];
    public:        
        CustomEventReceiver();

        virtual bool OnEvent(const SEvent &event);

		virtual bool isKeyDown(EKEY_CODE keyCode) const;
		virtual bool isKeyHandled(EKEY_CODE keyCode) const;

		void setKeyDown(EKEY_CODE keyCode, bool passedState);
		void setKeyHandled(EKEY_CODE keyCode, bool passedState);
		
		void setLeftButtonEventHandled(bool passedHandled);
		void setRightButtonEventHandled(bool passedHandled);
		
		MouseState* getMouseState();
		
};
